package com.mayikt.auth.service;


import com.alibaba.fastjson.JSONObject;
import com.mayikt.base.BaseResponse;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Api(tags = "authorizationService", description = "商户号服务")
public interface AuthorizationService {

    /**
     * 通过应用名appName申请商户号
     *
     * @param appName 应用名
     * @return
     */
    @GetMapping("/applyAppInfo")
    BaseResponse<JSONObject> applyAppInfo(@RequestParam(value = "appName") String appName);

    /**
     * 通过商户号appId 和 密钥secret 获取accessToken
     *
     * @param appId  商户号
     * @param secret  密钥
     * @return
     */
    @GetMapping("/accessToken")
    BaseResponse<JSONObject> getAccessToken(@RequestParam("appId") String appId,@RequestParam("secret") String secret);

    /**
     * 验证accessToken是否失效
     *
     * @param accessToken
     * @return
     */
    @GetMapping("/appInfo")
    BaseResponse<JSONObject> getAppInfo(@RequestParam("accessToken") String accessToken);
}
